package app

import (
	"github.com/gin-gonic/gin"
	"github.com/unknwon/com"
)

type BasePage struct {
	Page   int
	Size   int
	Blurry string
}

func GetParams(c *gin.Context) BasePage {
	var (
		page   int
		size   int
		blurry string
	)

	page = com.StrTo(c.DefaultQuery("page", "1")).MustInt()
	size = com.StrTo(c.DefaultQuery("size", "1")).MustInt()
	blurry = c.DefaultQuery("blurry", "")

	return BasePage{Page: page, Size: size, Blurry: blurry}
}
